#ifndef COMMONFUNC_H
#define COMMONFUNC_H

#include "common_lib_global.h"
#include "uv.h"
#include "framework.h"
#include <QStandardItemModel>
#include <QNetworkAccessManager>
#include <QTimer>

extern void uv_async_stop_loop(uv_async_t* handle);

class CnsStandardItemModel: public QStandardItemModel
{
    Q_OBJECT
public:
    Q_INVOKABLE CnsStandardItemModel(): QStandardItemModel()
    {
    }
};

CNS_DECL_METATYPE(CnsStandardItemModel);

class CnsNetworkAccessManager: public QNetworkAccessManager
{
    Q_OBJECT
public:
    Q_INVOKABLE CnsNetworkAccessManager(): QNetworkAccessManager()
    {
    }
};

CNS_DECL_METATYPE(CnsNetworkAccessManager);

class CnsTimer: public QTimer
{
    Q_OBJECT
public:
    Q_INVOKABLE CnsTimer(): QTimer()
    {
    }
};

CNS_DECL_METATYPE(CnsTimer);

#endif // COMMONFUNC_H
